package brac;

import java.util.ArrayList;

import fn.Function;

public abstract class Bracketing {
	protected String[] header;
	protected ArrayList<Double>[] values;

	public abstract void set();

	public abstract int[] fromTo();

	public void solveAndInit(Function fn, double pres, int itr, double a, double b) {
		set();
		solve(fn, pres, itr, a, b);
	}
	
	protected abstract void solve(Function fn, double pres, int itr, double a, double b);

	public String[] header() {
		return header;
	}

	public double feval(Function fn, double num) {
		return fn.evaluate(num);
	}

	public ArrayList<Double>[] values() {
		return values;
	}
	
	@Override
	public abstract String toString();

}
